package com.cn.yunhe.rentcars.web;

import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {
	
	
	@RequestMapping("/")
	public String showlogin() {
		
		return "login.html";
	}
	
	@RequestMapping("/loginvalid")
	public String loginvalid() {
		
		//TODO:校验用户
		
		//TODO:设置会话信息
		
		return "redirect:/home";
	}	
	
	
	@RequestMapping("/logout")
	public String logout(HttpSession session) {
		
		session.invalidate();
		
		return "redirect:login.html";
	}

	@RequestMapping("/home")
	public String index() {
				
		
		
		return "home";
	}
	
}
